CKEDITOR.plugins.add('gameCardIcons',{
  
  init: function(editor){
    
    
    
    editor.ui.addButton('spadesIcon',
      {
        label: 'Spades Icon',
        command: 'addSpadesIcon',
        icon: CKEDITOR.plugins.getPath('gameCardIcons') + 'images/spadesIcon.png'
      });
      
    editor.ui.addButton('diamondsIcon',
      {
        label: 'Diamonds Icon',
        command: 'addDiamondsIcon',
        icon: CKEDITOR.plugins.getPath('gameCardIcons') + 'images/diamondsIcon.png'
      });
      
    editor.ui.addButton('heartsIcon',
      {
        label: 'Hearts Icon',
        command: 'addHeartsIcon',
        icon: CKEDITOR.plugins.getPath('gameCardIcons') + 'images/heartsIcon.png'
      });
      
    editor.ui.addButton('clubsIcon',
      {
        label: 'Clubs Icon',
        command: 'addClubsIcon',
        icon: CKEDITOR.plugins.getPath('gameCardIcons') + 'images/clubsIcon.png'
      });
    
    editor.addCommand( 'addSpadesIcon',
      {
          exec : function( editor )
          {
              var path = CKEDITOR.plugins.getPath('gameCardIcons') + 'images/spadesIcon.png';
              editor.insertHtml('<img src="' + path + '" alt="spades" width="12" height="12" />');
          }
      });
      
    editor.addCommand( 'addDiamondsIcon',
      {
          exec : function( editor )
          {
              var path = CKEDITOR.plugins.getPath('gameCardIcons') + 'images/diamondsIcon.png';
              editor.insertHtml('<img src="' + path + '" alt="diamonds" width="12" height="12" />');
          }
      });
      
    editor.addCommand( 'addHeartsIcon',
      {
          exec : function( editor )
          {
              var path = CKEDITOR.plugins.getPath('gameCardIcons') + 'images/heartsIcon.png';
              editor.insertHtml('<img src="' + path + '" alt="hearts" width="12" height="12" />');
          }
      });
      
    editor.addCommand( 'addClubsIcon',
      {
          exec : function( editor )
          {
              var path = CKEDITOR.plugins.getPath('gameCardIcons') + 'images/clubsIcon.png';
              editor.insertHtml('<img src="' + path + '" alt="clubs" width="12" height="12" />');
          }
      });
  }
});